<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <ul id="list">
        <li>百度</li>
        <li>阿里</li>
        <li>腾讯</li>
      </ul>
   <script>
//    运行下面代码后，控制台打印的内容为
       var list=document.getElementById("list");
       var lis=list.querySelectorAll("li");
       list.replaceChild(lis[2],lis[1]);
       list.insertBefore(lis[1],list.children[2]);
   </script> 
</body>
</html>